package demo1;

public class Staff implements Comparable<Staff>{

    public String name;
    public int age;
    public double salary;

    public Staff(String name, int age, double salary){
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Staff{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", salary=" + salary +
                '}';
    }

    @Override
    public int compareTo(Staff o) {
        // return this.age - o.age;
        // return (int)(this.salary - o.salary);
        return this.name.compareTo(o.name);
    }

}
